home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / adoc2140.zip / CLEANDIR.BA_ / CLEANDIR.BA
Text File  |  1994-07-31  |  2KB  |  59 lines

  1. REM This example shows how batch files can be documented.  Note that both
  2. REM types of comment prefixes (REM and :::) are used.
  3.  
  4.  
  5. ::: @CHAPTER:BATCH
  6. ::: @FILE        CLEANDIR.BAT
  7. ::: @USAGE       cleandir directory [file-mask]
  8. ::: @DESCRIPTION This batch file is used to clean-out the directories which
  9. :::              comprise the AutoDoc build structure.
  10. ::: @PARAM       directory           DOSPATH
  11. :::              This parameter is the path to the directory which is to
  12. :::              be 'cleaned'.
  13. REM @PARAM       file-mask           DOSFILENAME
  14. REM              This parameter, which is optional, specifies a particular
  15. REM              file or set of files to be deleted.  It may contain
  16. REM              the wildcard characters * and ?.  If this parameter is not
  17. REM              specified, a full 'cleaning' is executed.
  18. REM @END
  19.  
  20.  
  21. @echo =====   Cleaning out %1   =====
  22. if not exist %1\NUL goto noDir
  23. cd %1 > c:\NUL
  24. :::
  25. ::: See if the user specified what's to be deleted
  26. if not "%2" == "" goto delParams
  27. :::
  28. ::: User didn't say what to delete so nail everything
  29. del *.obj > C:\NUL
  30. del *.rsp > C:\NUL
  31. del 0*. > C:\NUL
  32. del *.err > C:\NUL
  33. del *.hlp > c:\NUL
  34. del *.pch > c:\NUL
  35. del *.pmk > c:\NUL
  36. if exist putall.bat del putall.bat > c:\NUL
  37. if exist %1.res del *.res > C:\NUL
  38. if exist %1.dll del *.dll > C:\NUL
  39. if exist %1.exe del *.exe > C:\NUL
  40. if exist %1.map del *.map > c:\NUL
  41. if exist %1.lib del *.lib > c:\NUL
  42. if exist %1.bak del *.bak > c:\NUL
  43. if exist msvc.pdb del *.pdb > c:\NUL
  44. if exist %1.sbr del *.sbr > c:\NUL
  45. if exist %1.bsc del *.bsc > c:\NUL
  46. if exist %1.bsc del *.aps > c:\NUL
  47. goto exit
  48. :::
  49. ::: We get here if the caller supplied some set of files to be deleted
  50. ::: (ie, *.obj).  So, loop until %2 is empty.
  51. :delParams
  52. if "%2" == "" goto exit
  53. del %2 > c:\NUL
  54. shift
  55. goto delParams
  56. :exit
  57. cd ..
  58. :noDir
  59.